﻿@using VirtualPress.Infrastructure.Entities.Entity;
@using VirtualPress.Tool.Framework;
@using VirtualPress.Infrastructure.Entities.Enum;
@using VirtualPress.Infrastructure.HitMonitor;
@{
    Periodical data = ViewBag.Journal;
    News news = ViewBag.News;
    JournalHitPack journalHit = ViewBag.Hit;
    ViewBag.Title = news.Title;
    Layout = "/Views/Shared/_Main.cshtml";
    
}
<div class="container">
    <div class="row">
        <div class="span9">
            <!-- navagation -->
            <ul class="breadcrumb">
                <li><a href="/">首页</a> <span class="divider">/</span></li>
                <li><a href="/Journals/home/List">期刊</a> <span class="divider">/</span></li>
                <li><a href="/Journals/home/List/@((int)data.IndType)">@data.IndType.Mapping()</a> <span
                    class="divider">/</span></li>
                <li class="active">@data.Name</li>
            </ul>
            <div class="mini-layout">
                <!-- journal img -->
                <div class="span2">
                    <img style="width: 170px; height: 257px;" alt="@data.Name" src="@data.CoverImg" /></div>
                <!-- journal description -->
                <div class="span6">
                    <h4>
                        @data.Name @if (!data.IsActive)
                        { <b style="color: Red;">[该期刊已停用]</b> }</h4>
                        <h5>
                            @data.Name_EN</h5>
                        <hr class="grayline01" />
                        <p>
                            @data.Introduction.PieceOfString(0, 200, "......")</p>
                        <p>
                            ISSN: @if (!String.IsNullOrEmpty(data.ISSN_Online))
                        {
                            @Html.Raw(data.ISSN_Print)
                        }<br />
                        eISSN:
                        @if (!String.IsNullOrEmpty(data.ISSN_Online))
                        {
                            @Html.Raw(data.ISSN_Online)
                        }<br /> 编辑邮箱：@data.Email<br />
                        </p>
                </div>
            </div>
            <div class="content">
                <div class="newstitle">
                    @news.Title</div>
                <div class="newsinfo">
                    @news.CreateDate.ToString("yyyy年MM月dd日 HH:mm")
                    <br />
                    来源：@news.Form
                </div>
                <hr class="flline">
                <div class="newscontent">
                    @Html.Raw(news.Content)</div>
            </div>
        </div>
        <div class="span3">
            <div class="mini-layout">
                <div style="text-align: center;">
                    @if (HttpContext.Current.User.Identity.IsAuthenticated)
                    {
                        var user = new User().Find(HttpContext.Current.User.Identity.Name);
                        if (user.SystemRole == VirtualPress.Infrastructure.Entities.Enum.UserRole.Member)
                        {
                        <a href="/WorkSpace/member/Contribute?journal=@data.Id" class="btn btn-primary btn-large" style="width: 73%;">
                            我要投稿</a>
                        }
                        else
                        {
                        <a href="/Home/invalid/@data.Id" class="btn btn-primary btn-large" style="width: 73%">
                            我要投稿</a>
                        }
                    }
                    else
                    { 
                        <a href="/WorkSpace/member/Contribute?journal=@data.Id" class="btn btn-primary btn-large" style="width: 73%;">
                            我要投稿</a>
                    }
                </div>
                <div class="hspace15">
                </div>
                <div class="hspace15">
                </div>
                <div class="well" style="width: 73%; margin: auto">
                    <code>本刊下载量：<a>@journalHit.DownloadNumber</a></code>
                    <div class="hspace10">
                    </div>
                    <code>本刊访问量：<a>@journalHit.VisitNumber</a></code>
                </div>
                <div class="hspace15">
                </div>
                <div class="hspace15">
                </div>
                <div class="friendlinktop">
                    <i class="icon-folder-open"></i>资源下载
                    <hr class="flline" />
                </div>
                <div class="flinks" style="line-height: 180%">
                    @{
                        List<Download> files = ViewBag.DownloadFile;
                        if (files != null && files.Any())
                        {
                            foreach (var item in files)
                            {
                        <div>
                            <i class="icon-download"></i><a href="/download?token=@(EncodeByBase64.Encode(new VirtualPress.Portal.Web.Models.DownloadModel() { Id = item.Id, Type = 200 }.ToJson()))" target="_blank">
                                @item.Title</a></div>
                            }
                        }
                    }
                </div>
                <div class="hspace15">
                </div>
                <div class="hspace15">
                </div>
                @RenderPage("~/Views/Shared/Partial/_JournalFriendLinks.cshtml")
                <div class="hspace15">
                </div>
                <div class="hspace15">
                </div>
                @RenderPage("~/Views/Shared/Partial/_Consult.cshtml")
            </div>
        </div>
    </div>
</div>
@section tail
{
    <script type="text/javascript">
        $(function () {
            $('#lijournal').addClass('active');
        });
    </script>
}
